const http = require('http')

// 创建服务
const server  = http.createServer((request,response)=>{
    // 设置相应状态码
    response.statusCode = 201 //200--299都是成功
    // 设置相应头
    response.setHeader('Content-Type','text/html;charset=utf-8')
    // 设置相应体
    response.end(`<h1 style="color:skyblue">'Hello http!'</h1>`)
})

// 启动服务
server.listen(8989,()=>{
    console.log('启动服务: http://localhost:8989');
    (function(){console.log('测试');})()

})